package com.apexedu.biz.entity;

import com.apexedu.util.StringUtil;

import javax.persistence.*;
import java.util.Date;

/**
 * 规则信息表实体
 * User: liuxu
 * Date: 13-11-27
 * Time: 上午10:39
 */
@Table(name = "T_REGULATION")
@Entity
public class TRegulation {
    private String wid;
    private String bt;  //标题
    private String nr;    //内容
    private String fjdz;    //附件地址，在服务器上的相对路径
    private String fjmc;    //附件原名

    private String dyzdscfjdz;    //附件地址，在服务器上的相对路径
    private String dyzdscfjmc;    //附件原名

    private Integer djs;    //点击数
    private Date jlcssj;        //记录产生时间
    private Date jlxgsj;        //记录修改时间
    private Integer zys;    //资源数
    private String cjr;
    private String nrzy;    //内容摘要

    /**以下为2014.02.26新增属性**/
    private String ysxqfjurl;       //原始需求附件下载地址
    private String gzzdfjurl;       //规章制度附件下载地址
    private String ysxqfjsm;        //原始需求附件说明
    private String gzzdfjsm;        //规章制度附件说明
    private String sjgw;               //涉及岗位
    private String gzms;              //规则描述
    private String gzpzurl;           //规则配置

    private String ysxqfjmc;        //原始需求附件名称
    private String gzzdfjmc;        //规章制度附件名称

    @Column(name = "WID")
    @Id
    public String getWid() {
        return wid;
    }

    public void setWid(String wid) {
        this.wid = wid;
    }

    @Column(name = "BT")
    @Basic
    public String getBt() {
        return bt;
    }

    public void setBt(String bt) {
        this.bt = bt;
    }

    @Column(name = "NR")
    @Lob
    @Basic
    public String getNr() {
        return nr;
    }

    public void setNr(String nr) {
        this.nr = nr;
    }

    @Column(name = "FJDZ")
    @Basic
    public String getFjdz() {
        if(StringUtil.isNotEmpty(fjdz)){
           return StringUtil.replace(fjdz,"\\","/");
        }
        return fjdz;
    }

    public void setFjdz(String fjdz) {
        this.fjdz = fjdz;
    }

    @Column(name = "FJMC")
    @Basic
    public String getFjmc() {
        return fjmc;
    }

    public void setFjmc(String fjmc) {
        this.fjmc = fjmc;
    }

    @Column(name = "DYZDSCFJDZ")
    @Basic
    public String getDyzdscfjdz() {
        return dyzdscfjdz;
    }

    public void setDyzdscfjdz(String dyzdscfjdz) {
        this.dyzdscfjdz = dyzdscfjdz;
    }

    @Column(name = "DYZDSCFJMC")
    @Basic
    public String getDyzdscfjmc() {
        return dyzdscfjmc;
    }

    public void setDyzdscfjmc(String dyzdscfjmc) {
        this.dyzdscfjmc = dyzdscfjmc;
    }

    @Column(name = "DJS")
    @Basic
    public Integer getDjs() {
        return djs;
    }

    public void setDjs(Integer djs) {
        this.djs = djs;
    }

    @Column(name = "JLCSSJ")
    @Basic
    public Date getJlcssj() {
        return (Date) new Date().clone();
    }

    public void setJlcssj(Date jlcssj) {
        Date sj=(Date)new Date(jlcssj.getTime()).clone();
        this.jlcssj = sj;
    }

    @Column(name = "JLXGSJ")
    @Basic
    public Date getJlxgsj() {
        return (Date) new Date().clone();
    }

    public void setJlxgsj(Date jlxgsj) {
        Date sj=(Date) new Date(jlxgsj.getTime()).clone();
        this.jlxgsj = sj;
    }

    @Column(name = "ZYS")
    @Basic
    public Integer getZys() {
        return zys;
    }

    public void setZys(Integer zys) {
        this.zys = zys;
    }

    @Column(name = "CJR")
    @Basic
    public String getCjr() {
        return cjr;
    }

    public void setCjr(String cjr) {
        this.cjr = cjr;
    }

    @Column(name = "NRZY")
    @Basic
    public String getNrzy() {
        return nrzy;
    }

    public void setNrzy(String nrzy) {
        this.nrzy = nrzy;
    }

    @Basic
    @Column(name = "YSXQFJURL")
    public String getYsxqfjurl() {
        return ysxqfjurl;
    }

    public void setYsxqfjurl(String ysxqfjurl) {
        this.ysxqfjurl = ysxqfjurl;
    }

    @Basic
    @Column(name = "GZZDFJURL")
    public String getGzzdfjurl() {
        return gzzdfjurl;
    }

    public void setGzzdfjurl(String gzzdfjurl) {
        this.gzzdfjurl = gzzdfjurl;
    }

    @Basic
    @Column(name = "YSXQFJSM")
    public String getYsxqfjsm() {
        return ysxqfjsm;
    }

    public void setYsxqfjsm(String ysxqfjsm) {
        this.ysxqfjsm = ysxqfjsm;
    }

    @Basic
    @Column(name = "GZZDFJSM")
    public String getGzzdfjsm() {
        return gzzdfjsm;
    }

    public void setGzzdfjsm(String gzzdfjsm) {
        this.gzzdfjsm = gzzdfjsm;
    }

    @Basic
    @Column(name = "SJGW")
    public String getSjgw() {
        return sjgw;
    }

    public void setSjgw(String sjgw) {
        this.sjgw = sjgw;
    }

    @Basic
    @Column(name = "GZMS")
    public String getGzms() {
        return gzms;
    }

    public void setGzms(String gzms) {
        this.gzms = gzms;
    }

    @Basic
    @Column(name = "GZPZURL")
    public String getGzpzurl() {
        return gzpzurl;
    }

    public void setGzpzurl(String gzpzurl) {
        this.gzpzurl = gzpzurl;
    }
    @Basic
    @Column(name = "YSXQFJMC")
    public String getYsxqfjmc() {
        return ysxqfjmc;
    }

    public void setYsxqfjmc(String ysxqfjmc) {
        this.ysxqfjmc = ysxqfjmc;
    }
    @Basic
    @Column(name = "GZZDFJMC")
    public String getGzzdfjmc() {
        return gzzdfjmc;
    }

    public void setGzzdfjmc(String gzzdfjmc) {
        this.gzzdfjmc = gzzdfjmc;
    }
}
